﻿<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output media-type="text/plain" method="text" omit-xml-declaration="yes" indent="no" encoding="utf-8" />

<xsl:template match="/">

    <xsl:apply-templates select="AssemblyDifference" />
    
</xsl:template>
  
<xsl:template match="AssemblyDifference">

<xsl:value-of select="@Name" />
===============================

<xsl:call-template name="navigation" />

<xsl:value-of select="@Name" />  
-------------------------------

| Summary of changes |         |
| ------------------ | ------- |

| % Churn  | <xsl:value-of select="@PercentChurn" />         |
| From     | <xsl:value-of select="@From" />                 |
| To       | <xsl:value-of select="@To" />                   |
| Removed  | <xsl:value-of select="count(RemovedTypes/*)"/>  |
| Obsolete | <xsl:value-of select="count(ObsoleteTypes/*)"/> |
| Changed  | <xsl:value-of select="count(ChangedTypes/*)"/>  |
| Added    | <xsl:value-of select="count(AddedTypes/*)"/>    |

<xsl:apply-templates select="RemovedTypes"/>

<xsl:apply-templates select="ObsoleteTypes"/>

<xsl:apply-templates select="ChangedTypes"/>

<xsl:apply-templates select="AddedTypes"/>


<xsl:call-template name="navigation" />

Generated by [<xsl:value-of select="@ProductName" /> version <xsl:value-of select="@ProductVersion" />](<xsl:value-of select="@ProductLink" />)

</xsl:template>

<xsl:template match="ChangedTypes">

<xsl:call-template name="write_table">
<xsl:with-param name="title" select="'Changed Types'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="ObsoleteTypes">

<xsl:call-template name="write_table">
<xsl:with-param name="title" select="'Obsolete Types'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="RemovedTypes">

<xsl:call-template name="write_table">
<xsl:with-param name="title" select="'Removed Types'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="AddedTypes">

<xsl:call-template name="write_table">
<xsl:with-param name="title" select="'Added Types'" />
</xsl:call-template>

</xsl:template>

<xsl:template name="write_table" >
<xsl:param name="title" />

<xsl:value-of select="$title" />
--------------------------------  

| <xsl:value-of select="$title" /> |
| ---------------------------------- |
<xsl:apply-templates />

</xsl:template>

<xsl:template match="TypeNameReference">

| [<xsl:value-of select="@TypeName" />](<xsl:value-of select="@SafeName" />.html) |

</xsl:template>

<xsl:template match="Type">

| <xsl:value-of select="@Name" /> |

<xsl:if test="string-length(@Message) != 0">

 <xsl:value-of select="@Message" /> |

</xsl:if>

</xsl:template>

<xsl:template name="navigation">

[Summary](<xsl:value-of select="@SummaryName" />.html)

</xsl:template>

</xsl:stylesheet>
